package co.edu.uniandes.distribuidos.checkpoint.events;

import co.edu.uniandes.distribuidos.peer.Peer;

public abstract class Event {
	
	protected int consecutive=-1;
	
	public abstract void execute(Peer peer);

	public void setConsecutive(int consecutive){
		this.consecutive=consecutive;
	}
	
	public int getConsecutive(){
		return consecutive;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + consecutive;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Event other = (Event) obj;
		if (consecutive != other.consecutive)
			return false;
		return true;
	}
	

}
